#ifndef __SMI_H__
#define __SMI_H__

#include <rtk_types.h>
#include "rtk_error.h"
#define MDC_MDIO_OPERATION 1
#define MDC_MDIO_PREAMBLE_LEN 32

#define MDC_MDIO_CTRL_REG 21
#define MDC_MDIO_ADDR_REG 22
#define MDC_MDIO_DATA_LOW 23
#define MDC_MDIO_DATA_HIGH 24
#define MDC_MDIO_READ_CMD 0x1B
#define MDC_MDIO_WRITE_CMD 0x19

#define SPI_READ_OP 0x3
#define SPI_WRITE_OP 0x2
#define SPI_READ_OP_LEN 0x8
#define SPI_WRITE_OP_LEN 0x8
#define SPI_REG_LEN 16
#define SPI_DATA_LEN 16

#define GPIO_DIR_IN 1
#define GPIO_DIR_OUT 0

#define ack_timer 5

#define DELAY 10000
#define CLK_DURATION(clk)         \
    {                             \
        int i;                    \
        for (i = 0; i < clk; i++) \
            ;                     \
    }

rtk_int32 rtl8373_smi_read(rtk_uint32 mAddrs, rtk_uint32 *rData);
rtk_int32 rtl8373_smi_write(rtk_uint32 mAddrs, rtk_uint32 rData);

#endif /* __SMI_H__ */
